﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DataModel;
using System.Transactions;
using Common;
using System.Collections.Generic;
namespace SCMWS
{
    public class WSBll
    {
        public static void GenerateReconcilations()
        {
            bool isActived = false;
            //当前日期判断。

            if (isActived)
            {
                try
                {

                    using (TransactionScope scope = new TransactionScope())
                    {
                        //订货总金额
                        decimal POTotalPrice = 0;
                        //退货总金额
                        decimal ROTotalPrice = 0;
                        //按照供应商循环
                        List<M_Supplier> suppliers = M_Supplier.All().ToList();
                        foreach (var sup in suppliers)
                        {
                            //找出当月财务已确认的单据（订货和退货）
                            //供货商订货表中 发生日期<=本月 And 状态=财务已确认

                            //商品进价Cost1*(1+商品税率)*实际到货数量(ActualQty)
                            //供货商退货表中 发生日期<=本月 And 状态=财务已确认

                        }


                        scope.Complete();
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Error("付款单生成失败", ex);
                }

            }

 
        }

    }
}
